/*
 * vectorParam.c
 *
 *  Created on: May 25, 2013
 *      Author: koldar
 */


#include "vectorParam.h"
#include "main-tools.h"

PvectorParam initVectorParam(float _x1,float _x2){
	PvectorParam result=(PvectorParam)malloc(sizeof(VectorParam));
	checkMalloc(result,"st-math-tools.c:initVectorParam:1");
	result->x1=_x1;
	result->x2=_x2;
	return result;
}

void freeVectorParam(PvectorParam obj){
	free(obj);
}

PvectorParam computeDifference(PvectorParam a,PvectorParam b){
	return initVectorParam(a->x1-b->x1,a->x2-b->x2);
}

void printVectorParam(FILE* f, PvectorParam obj){
	fprintf(f,"[%f %f]T",obj->x1,obj->x2);
}
